package qldc.pm.tiensu.service.persistence;

import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;

import java.io.Serializable;


public class PhieuThongTinVeNguoiCoTienSuPK implements Comparable<PhieuThongTinVeNguoiCoTienSuPK>,
    Serializable {
    public long IDMa;
    public long IDHoSoTienSu;

    public PhieuThongTinVeNguoiCoTienSuPK() {
    }

    public PhieuThongTinVeNguoiCoTienSuPK(long IDMa, long IDHoSoTienSu) {
        this.IDMa = IDMa;
        this.IDHoSoTienSu = IDHoSoTienSu;
    }

    public long getIDMa() {
        return IDMa;
    }

    public void setIDMa(long IDMa) {
        this.IDMa = IDMa;
    }

    public long getIDHoSoTienSu() {
        return IDHoSoTienSu;
    }

    public void setIDHoSoTienSu(long IDHoSoTienSu) {
        this.IDHoSoTienSu = IDHoSoTienSu;
    }

    @Override
    public int compareTo(PhieuThongTinVeNguoiCoTienSuPK pk) {
        if (pk == null) {
            return -1;
        }

        int value = 0;

        if (IDMa < pk.IDMa) {
            value = -1;
        } else if (IDMa > pk.IDMa) {
            value = 1;
        } else {
            value = 0;
        }

        if (value != 0) {
            return value;
        }

        if (IDHoSoTienSu < pk.IDHoSoTienSu) {
            value = -1;
        } else if (IDHoSoTienSu > pk.IDHoSoTienSu) {
            value = 1;
        } else {
            value = 0;
        }

        if (value != 0) {
            return value;
        }

        return 0;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }

        if (!(obj instanceof PhieuThongTinVeNguoiCoTienSuPK)) {
            return false;
        }

        PhieuThongTinVeNguoiCoTienSuPK pk = (PhieuThongTinVeNguoiCoTienSuPK) obj;

        if ((IDMa == pk.IDMa) && (IDHoSoTienSu == pk.IDHoSoTienSu)) {
            return true;
        } else {
            return false;
        }
    }

    @Override
    public int hashCode() {
        return (String.valueOf(IDMa) + String.valueOf(IDHoSoTienSu)).hashCode();
    }

    @Override
    public String toString() {
        StringBundler sb = new StringBundler(10);

        sb.append(StringPool.OPEN_CURLY_BRACE);

        sb.append("IDMa");
        sb.append(StringPool.EQUAL);
        sb.append(IDMa);

        sb.append(StringPool.COMMA);
        sb.append(StringPool.SPACE);
        sb.append("IDHoSoTienSu");
        sb.append(StringPool.EQUAL);
        sb.append(IDHoSoTienSu);

        sb.append(StringPool.CLOSE_CURLY_BRACE);

        return sb.toString();
    }
}
